import {BaseEntity, Column, Entity, Index, JoinColumn, JoinTable, ManyToMany, ManyToOne, OneToMany, OneToOne, PrimaryColumn, PrimaryGeneratedColumn, RelationId} from 'typeorm';

@Entity('mall_user', {schema: 'nest-mall' } )
@Index('user_name', ['username' ], {unique: true})
export class MallUser {

    @PrimaryGeneratedColumn({
        type: 'mediumint',
        name: 'id',
        })
    id: number;

    @Column('varchar', {
        nullable: false,
        unique: true,
        length: 60,
        name: 'username',
        })
    username: string;

    @Column('varchar', {
        nullable: true,
        length: 32,
        name: 'password',
        })
    password: string | null;

    @Column('tinyint', {
        nullable: true,
        width: 1,
        name: 'gender',
        })
    gender: boolean | null;

    @Column('datetime', {
        nullable: true,
        name: 'birthday',
        })
    birthday: Date | null;

    @Column('datetime', {
        nullable: true,
        name: 'register_time',
        })
    registerTime: Date | null;

    @Column('datetime', {
        nullable: true,
        name: 'last_login_time',
        })
    lastLoginTime: Date | null;

    @Column('varchar', {
        nullable: true,
        length: 15,
        name: 'last_login_ip',
        })
    lastLoginIp: string | null;

    @Column('tinyint', {
        nullable: true,
        name: 'user_level_id',
        })
    userLevelId: number | null;

    @Column('varchar', {
        nullable: true,
        length: 60,
        name: 'nickname',
        })
    nickname: string | null;

    @Column('varchar', {
        nullable: true,
        length: 20,
        name: 'mobile',
        })
    mobile: string | null;

    @Column('varchar', {
        nullable: true,
        length: 45,
        name: 'register_ip',
        })
    registerIp: string | null;

    @Column('varchar', {
        nullable: true,
        name: 'avatar',
        })
    avatar: string | null;

    @Column('varchar', {
        nullable: true,
        length: 50,
        name: 'weixin_openid',
        })
    weixinOpenid: string | null;

}
